<template>
	<view class="container">
		<view class="input_box ">
			<view class="title ">手机号码</view>
			<input type="text" v-model="phone" placeholder="请输入手机号码">
		</view>
		<view class="input_box">
			<view class="title hh">密码</view>
			<input type="number" v-model="pwd" maxlength="11" placeholder="请输入密码">
		</view>
		<view class="sebtns" @click="addbank">登录</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				phone: '',
				pwd: '',
			}
		},
		onLoad() {
			// this.getArea()
		},
		methods: {
			getArea() {
				this.$u.api.getArea().then(res => {

				})
			},
			mapClick() {
				uni.chooseLocation({
					success: res => {
						console.log(res)
						this.city = res.address
					}
				});
			},

			addbank() {
				if (this.phone == '') {
					this.$u.toast('手机号不能为空')
					return
				} else if (this.pwd == '') {
					this.$u.toast('密码不能为空')
					return
				} else {
					let model = {
						// id: this.id,
						phone: this.phone,
						pwd: this.pwd,
					}
					this.$allApi.riderRenzheng(model).then(res => {
						if (res.msg == '登录成功') {
							this.$u.toast('登录成功')
							setTimeout(() => {
								this.$backTo()
							}, 2000)
						} else {

							this.$u.toast(res.msg)
						}

					})
				}
			}
		}
	}
</script>

<style scoped lang="scss">
	.bottom {
		margin-top: 20rpx;
		background: #fff;
		padding: 20rpx;
		color: #666;
		line-height: 1.8;

		.title {
			font-size: 30rpx;
		}

		.btn_S {
			display: flex;
			align-items: center;
			justify-content: space-between;

			.text {
				font-size: 24rpx;
				flex: 1;
				padding-right: 20rpx;
			}
		}
	}

	.container {
		min-height: 100vh;
		background: #f6f6f6;
	}

	.input_box {
		display: flex;
		align-items: center;
		height: 110rpx;
		border-bottom: 1px solid #eee;
		padding: 20rpx;
		background: #fff;

		.title {}

		.hh {
			letter-spacing: 2em;
			/*如果需要y个字两端对齐，则为(x-y)/(y-1),这里是（4-3）/(3-1)=0.5em */
			margin-right: -2em;
			/*同上*/
		}

		input {
			flex: 1;
			padding-left: 30rpx;
		}
	}

	.sebtns {
		margin-top: 50px;
		width: 100vw;
		background: #EA3D37;
		color: #fff;
		font-size: 32rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 35rpx;
		height: 70rpx;

		bottom: calc(20rpx + constant(safe-area-inset-bottom));
		bottom: calc(20rpx + env(safe-area-inset-bottom));
	}
</style>